﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using PalBattleEmulator.Battle;

namespace PalBattleEmulator.Graphic
{
    /// <summary>
    /// GraphicControl.xaml 的交互逻辑
    /// </summary>
    public partial class GameGraphicManager : UserControl
    {

        public GameGraphicManager()
        {
            InitializeComponent();
            this.Width = GlobalConfig.GRAPHIC_WIDTH;
            this.Height = GlobalConfig.GRAPHIC_HEIGHT;
        }

        private delegate void battleInitialzeDelegate(GameBattle battle);

        public void BattleStart(GameBattle battle)
        {
            object[] args = new object[] { battle };
            battleFieldLayer.BattleInitialize(battle);
            unitLayer.BattleInitialize(battle);
            
        }

        public void BattleRedraw()
        {
            battleFieldLayer.Redraw();
            unitLayer.DrawUnits();
            ContextModules.GameClockManager.Sleep(GlobalConfig.GAME_CLOCK_SPAN);
        }
    }
}
